<?
header("Content-Type:text/html;charset=utf-8");
include_once 'include/include.php';
c_create::createClass('setPage');
$page = new setPage();
c_create::createClass('blessing');
$blessing = new blessing();
$outvar[headline] = '访客投稿信息列表';
if ($_GET[Bdelete_id]){
	if ($blessing->deleteRecord($_GET[Bdelete_id])){
		$_SESSION[showtips]	 = '放入回收站成功！';
	}else {
		$_SESSION[showtips]	 = '放入回收站失败！';
	}
}
if ($_GET[PyBdelete_id]){
	if ($blessing->physicalDeleteRecord($_GET[PyBdelete_id])){
		$_SESSION[showtips]	 = '删除成功！';
	}else {
		$_SESSION[showtips]	 = '删除失败！';
	}
}
if ($_GET[Bdeal_id]){
	if ($blessing->dealBlessing($_GET[Bdeal_id])){
		$_SESSION[showtips]	 = '设置处理标识成功！';
	}else {
		$_SESSION[showtips]	 = '设置处理标识失败！';
	}
}
$where = TABLE_BLESSING." WHERE Bfromname<>'' ";
if ($_GET['Bdelete']){
	$where .=" AND Bdelete='y'";
	$outvar['Bdelete'] = $_GET['Bdelete'];
}
if ($_GET['Bdeal']){
	$where .= " AND Bdeal='y'";
	$outvar['Bdeal'] = $_GET['Bdeal'];
}
//待处理信息
if ($_GET['Bwait']){
	$where .= " AND Bdeal='n' AND Bdelete='n'";
	$outvar['Bwait'] = $_GET['Bwait'];
}

$where = " $where ORDER BY Bid DESC, Bupdate DESC";
$query = "SELECT COUNT(*) FROM ".$where;
$page->setPagePHP(20,10,$dbconn->Getonefield($query));
$query = "SELECT * FROM ".$where.$page->limit;
$nowQueryid = $dbconn->Query($query);
$i = 0;
while ($row = $dbconn->next_record($nowQueryid)){
	$row[num] = $i+1;
	$array[] = $row;
	$i++;
}
$outvar[page] = $page->menuAll;
$outvar[record] = $array;
outFile("blessinglist");
?>